package com.esri.core.ags;

import com.esri.core.geometry.Geometry;
import com.esri.core.geometry.MapGeometry;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.util.d;
import com.esri.core.map.DrawingInfo;
import com.esri.core.map.EditFieldsInfo;
import com.esri.core.map.FeatureTemplate;
import com.esri.core.map.FeatureType;
import com.esri.core.map.Field;
import com.esri.core.map.LayerRelationship;
import com.esri.core.map.OwnershipBasedAccessControlForFeatures;
import com.esri.core.map.TimeInfo;
import com.esri.core.renderer.Renderer;
import com.github.mikephil.charting.utils.Utils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class LayerServiceInfo implements Serializable {
    private static final long serialVersionUID = 1;
    String C;
    List<FeatureTemplate> D;
    List<LayerRelationship> E;
    String F;
    LayerServiceCapabilities G;
    boolean I;
    TimeInfo J;
    EditFieldsInfo K;
    boolean L;
    boolean M;
    boolean N;
    OwnershipBasedAccessControlForFeatures O;
    String a;
    String b;
    String c;
    String d;
    String e;
    int f;
    String g;
    int h;
    String i;
    boolean j;
    List<Integer> l;
    MapGeometry m;
    double p;
    double q;
    String s;
    DrawingInfo t;
    String u;
    SpatialReference v;
    String w;
    String x;
    String y;
    boolean z;
    int k = -1;
    double n = Utils.DOUBLE_EPSILON;
    double o = Utils.DOUBLE_EPSILON;
    Renderer r = null;
    LinkedHashMap<String, Field> A = new LinkedHashMap<>();
    LinkedHashMap<String, FeatureType> B = new LinkedHashMap<>();
    boolean H = true;
    boolean P = false;
    double Q = Utils.DOUBLE_EPSILON;
    boolean R = false;
    boolean S = false;

    LayerServiceInfo() {
    }

    public String getType() {
        return this.F;
    }

    public void setType(String str) {
        this.F = str;
    }

    LayerServiceInfo(String str) {
        this.d = str;
    }

    public String getVersion() {
        return this.e;
    }

    public int getMaxRecordCount() {
        return this.f;
    }

    public String getSupportedQueryFormats() {
        return this.g;
    }

    public LayerServiceCapabilities getCapabilities() {
        return this.G;
    }

    public void setCapabilities(String str) {
        this.G = new LayerServiceCapabilities(str);
    }

    public static LayerServiceInfo fromJson(JsonParser jsonParser) throws Exception {
        return fromJson(jsonParser, null);
    }

    public static LayerServiceInfo fromJson(JsonParser jsonParser, LayerServiceInfo layerServiceInfo) throws Exception {
        Field field;
        Field field2;
        Field field3;
        Field field4;
        if (d.c(jsonParser)) {
            LinkedHashMap<String, Field> linkedHashMap = new LinkedHashMap<>();
            if (layerServiceInfo == null) {
                layerServiceInfo = new LayerServiceInfo();
            }
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if ("currentVersion".equals(currentName)) {
                    layerServiceInfo.e = jsonParser.getText();
                } else if ("serviceDescription".equals(currentName)) {
                    layerServiceInfo.c = jsonParser.getText();
                } else if ("id".equals(currentName)) {
                    layerServiceInfo.h = jsonParser.getIntValue();
                } else if ("type".equals(currentName)) {
                    layerServiceInfo.F = jsonParser.getText();
                } else if ("name".equals(currentName)) {
                    layerServiceInfo.i = jsonParser.getText();
                } else if ("definitionExpression".equals(currentName)) {
                    layerServiceInfo.C = jsonParser.getText();
                } else if ("defaultVisibility".equals(currentName)) {
                    layerServiceInfo.j = jsonParser.getBooleanValue();
                } else if ("parentLayerId".equals(currentName)) {
                    layerServiceInfo.k = jsonParser.getIntValue();
                } else if ("maxRecordCount".equals(currentName)) {
                    layerServiceInfo.f = jsonParser.getIntValue();
                } else if ("supportedQueryFormats".equals(currentName)) {
                    layerServiceInfo.g = jsonParser.getText();
                } else if ("capabilities".equals(currentName)) {
                    layerServiceInfo.G = new LayerServiceCapabilities(jsonParser.getText());
                } else if ("subLayerIds".equals(currentName)) {
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        layerServiceInfo.l = new ArrayList();
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            layerServiceInfo.l.add(Integer.valueOf(jsonParser.getIntValue()));
                        }
                    }
                } else if ("extent".equals(currentName)) {
                    layerServiceInfo.m = d.e(jsonParser);
                } else if ("minScale".equals(currentName)) {
                    layerServiceInfo.n = jsonParser.getDoubleValue();
                } else if ("maxScale".equals(currentName)) {
                    layerServiceInfo.o = jsonParser.getDoubleValue();
                } else if ("effectiveMinScale".equals(currentName)) {
                    layerServiceInfo.p = jsonParser.getDoubleValue();
                } else if ("effectiveMaxScale".equals(currentName)) {
                    layerServiceInfo.q = jsonParser.getDoubleValue();
                } else if ("displayField".equals(currentName)) {
                    layerServiceInfo.s = jsonParser.getText();
                } else if ("drawingInfo".equals(currentName)) {
                    layerServiceInfo.t = DrawingInfo.fromJson(jsonParser);
                } else if ("geometryType".equals(currentName)) {
                    layerServiceInfo.u = jsonParser.getText();
                } else if ("objectIdField".equals(currentName)) {
                    layerServiceInfo.w = jsonParser.getText();
                } else if ("globalIdField".equals(currentName)) {
                    layerServiceInfo.x = jsonParser.getText();
                } else if ("typeIdField".equals(currentName)) {
                    layerServiceInfo.y = jsonParser.getText();
                } else if ("allowGeometryUpdates".equals(currentName)) {
                    layerServiceInfo.H = jsonParser.getBooleanValue();
                } else if ("isDataVersioned".equals(currentName)) {
                    layerServiceInfo.I = jsonParser.getBooleanValue();
                } else if ("supportsRollbackOnFailureParameter".equals(currentName)) {
                    layerServiceInfo.L = jsonParser.getBooleanValue();
                } else if ("supportsStatistics".equals(currentName)) {
                    layerServiceInfo.M = jsonParser.getBooleanValue();
                } else if ("supportsAdvancedQueries".equals(currentName)) {
                    layerServiceInfo.N = jsonParser.getBooleanValue();
                } else if ("hasAttachments".equals(currentName)) {
                    layerServiceInfo.z = jsonParser.getBooleanValue();
                } else if ("fields".equals(currentName)) {
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            Field fromJson = Field.fromJson(jsonParser);
                            if (80 == fromJson.getFieldType()) {
                                layerServiceInfo.w = fromJson.getName();
                            }
                            linkedHashMap.put(fromJson.getName().toLowerCase(), fromJson);
                        }
                    }
                    layerServiceInfo.A = linkedHashMap;
                    linkedHashMap.isEmpty();
                } else if ("types".equals(currentName)) {
                    layerServiceInfo.B = new LinkedHashMap<>();
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            FeatureType fromJson2 = FeatureType.fromJson(jsonParser);
                            layerServiceInfo.B.put(fromJson2.getId(), fromJson2);
                        }
                    }
                } else if ("templates".equals(currentName)) {
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        layerServiceInfo.D = new ArrayList();
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            layerServiceInfo.D.add(FeatureTemplate.fromJson(jsonParser));
                        }
                    }
                } else if ("editFieldsInfo".equals(currentName)) {
                    layerServiceInfo.K = EditFieldsInfo.fromJson(jsonParser);
                } else if ("ownershipBasedAccessControlForFeatures".equals(currentName)) {
                    layerServiceInfo.O = OwnershipBasedAccessControlForFeatures.fromJson(jsonParser);
                } else if ("relationships".equals(currentName)) {
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        layerServiceInfo.E = new ArrayList();
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            layerServiceInfo.E.add(LayerRelationship.fromJson(jsonParser));
                        }
                    }
                } else if ("timeInfo".equals(currentName)) {
                    layerServiceInfo.J = TimeInfo.fromJson(jsonParser);
                } else if ("zDefault".equals(currentName)) {
                    layerServiceInfo.Q = jsonParser.getDoubleValue();
                } else if ("enableZDefaults".equals(currentName)) {
                    layerServiceInfo.P = jsonParser.getBooleanValue();
                } else if ("hasZ".equals(currentName)) {
                    layerServiceInfo.R = jsonParser.getBooleanValue();
                } else if ("hasM".equals(currentName)) {
                    layerServiceInfo.S = jsonParser.getBooleanValue();
                } else if ("copyrightText".equals(currentName)) {
                    layerServiceInfo.a = jsonParser.getText();
                } else if ("description".equals(currentName)) {
                    layerServiceInfo.b = jsonParser.getText();
                } else {
                    jsonParser.skipChildren();
                }
            }
            if (!linkedHashMap.isEmpty()) {
                String str = layerServiceInfo.s;
                if (str != null && (field4 = linkedHashMap.get(str.toLowerCase())) != null) {
                    layerServiceInfo.s = field4.getName();
                }
                String str2 = layerServiceInfo.x;
                if (str2 != null && (field3 = linkedHashMap.get(str2.toLowerCase())) != null) {
                    layerServiceInfo.x = field3.getName();
                }
                String str3 = layerServiceInfo.y;
                if (str3 != null && (field2 = linkedHashMap.get(str3.toLowerCase())) != null) {
                    layerServiceInfo.y = field2.getName();
                }
                String str4 = layerServiceInfo.w;
                if (str4 != null && (field = linkedHashMap.get(str4.toLowerCase())) != null) {
                    layerServiceInfo.w = field.getName();
                }
            }
            return layerServiceInfo;
        }
        return null;
    }

    public String getCopyrightText() {
        return this.a;
    }

    public String getDescription() {
        return this.b;
    }

    public String getServiceDescription() {
        return this.c;
    }

    public String getDisplayField() {
        return this.s;
    }

    public MapGeometry getExtent() {
        return this.m;
    }

    public void setExtent(MapGeometry mapGeometry) {
        this.m = mapGeometry;
    }

    public boolean isAllowGeometryUpdates() {
        return this.H;
    }

    public boolean isDataVersioned() {
        return this.I;
    }

    public boolean isSupportsRollbackOnFailureParameter() {
        return this.L;
    }

    public boolean isSupportsStatistics() {
        return this.M;
    }

    public boolean isSupportsAdvancedQueries() {
        return this.N;
    }

    public Field[] getFields() {
        return (Field[]) this.A.values().toArray(new Field[this.A.values().size()]);
    }

    public Field getField(String str) {
        return this.A.get(str);
    }

    public Geometry.Type getGeometryType() {
        return d.b(this.u);
    }

    public String getGlobalIdField() {
        return this.x;
    }

    public List<FeatureTemplate> getTemplates() {
        return this.D;
    }

    public void setTemplates(List<FeatureTemplate> list) {
        this.D = list;
    }

    public FeatureType[] getSubTypes() {
        return (FeatureType[]) this.B.values().toArray(new FeatureType[0]);
    }

    public FeatureType getSubType(String str) {
        if (this.B.isEmpty()) {
            return null;
        }
        return this.B.get(str);
    }

    public void setSubTypes(FeatureType[] featureTypeArr) {
        for (FeatureType featureType : featureTypeArr) {
            this.B.put(featureType.getId(), featureType);
        }
    }

    public int getId() {
        return this.h;
    }

    public String getName() {
        return this.i;
    }

    public double getMinScale() {
        return this.n;
    }

    public double getMaxScale() {
        return this.o;
    }

    public double getEffectiveMinScale() {
        return this.p;
    }

    public double getEffectiveMaxScale() {
        return this.q;
    }

    public String getObjectIdField() {
        return this.w;
    }

    public int getParentLayerId() {
        return this.k;
    }

    public Renderer getRenderer() {
        return this.r;
    }

    public List<Integer> getSubLayerIds() {
        return this.l;
    }

    public boolean hasZ() {
        return this.R;
    }

    public boolean hasM() {
        return this.S;
    }

    public double getDefaultZ() {
        return this.Q;
    }

    public boolean isDefaultZEnabled() {
        return this.P;
    }

    public String getTypeIdField() {
        return this.y;
    }

    public String getURL() {
        return this.d;
    }

    public List<LayerRelationship> getRelationShips() {
        return this.E;
    }

    public TimeInfo getTimeInfo() {
        return this.J;
    }

    public boolean isDefaultVisibility() {
        return this.j;
    }

    public boolean isHasAttachments() {
        return this.z;
    }

    public DrawingInfo getDrawingInfo() {
        return this.t;
    }

    public void setDrawingInfo(DrawingInfo drawingInfo) {
        this.t = drawingInfo;
    }

    public void setURL(String str) {
        this.d = str;
    }

    public String getDefinitionExpression() {
        return this.C;
    }

    public String toString() {
        return "Layers [id=" + this.h + ", name=" + this.i + ", defaultVisibility=" + this.j + ", parentLayerId=" + this.k + ", \n subLayerIds=" + this.l + ",\n geometryType=" + this.u + ",\n fields=null,\n objectIdField=" + this.w + ", globalIdField=" + this.x + ", typeIdField=" + this.y + ",\n featureTypes=null,\n hasAttachments=" + this.z + ",\n definitionExpression=" + this.C + "]";
    }

    public int hashCode() {
        LayerServiceCapabilities layerServiceCapabilities = this.G;
        int hashCode = ((((layerServiceCapabilities == null ? 0 : layerServiceCapabilities.hashCode()) + 31) * 31) + (this.j ? 1231 : 1237)) * 31;
        String str = this.C;
        int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
        String str2 = this.s;
        int hashCode3 = (hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31;
        DrawingInfo drawingInfo = this.t;
        int hashCode4 = (hashCode3 + (drawingInfo == null ? 0 : drawingInfo.hashCode())) * 31;
        MapGeometry mapGeometry = this.m;
        int hashCode5 = (hashCode4 + (mapGeometry == null ? 0 : mapGeometry.hashCode())) * 31;
        LinkedHashMap<String, FeatureType> linkedHashMap = this.B;
        int hashCode6 = (hashCode5 + (linkedHashMap == null ? 0 : linkedHashMap.hashCode())) * 31;
        LinkedHashMap<String, Field> linkedHashMap2 = this.A;
        int hashCode7 = (hashCode6 + (linkedHashMap2 == null ? 0 : linkedHashMap2.hashCode())) * 31;
        String str3 = this.u;
        int hashCode8 = (hashCode7 + (str3 == null ? 0 : str3.hashCode())) * 31;
        String str4 = this.x;
        int hashCode9 = ((((((((((((((hashCode8 + (str4 == null ? 0 : str4.hashCode())) * 31) + (this.z ? 1231 : 1237)) * 31) + (this.H ? 1231 : 1237)) * 31) + (this.I ? 1231 : 1237)) * 31) + (this.N ? 1231 : 1237)) * 31) + (this.L ? 1231 : 1237)) * 31) + (this.M ? 1231 : 1237)) * 31) + this.h;
        long doubleToLongBits = Double.doubleToLongBits(this.o);
        long doubleToLongBits2 = Double.doubleToLongBits(this.n);
        int i = ((((hashCode9 * 31) + ((int) (doubleToLongBits ^ (doubleToLongBits >>> 32)))) * 31) + ((int) (doubleToLongBits2 ^ (doubleToLongBits2 >>> 32)))) * 31;
        String str5 = this.i;
        int hashCode10 = (i + (str5 == null ? 0 : str5.hashCode())) * 31;
        String str6 = this.w;
        int hashCode11 = (((hashCode10 + (str6 == null ? 0 : str6.hashCode())) * 31) + this.k) * 31;
        Renderer renderer = this.r;
        int hashCode12 = (hashCode11 + (renderer == null ? 0 : renderer.hashCode())) * 31;
        SpatialReference spatialReference = this.v;
        int hashCode13 = (hashCode12 + (spatialReference == null ? 0 : spatialReference.hashCode())) * 31;
        List<Integer> list = this.l;
        int hashCode14 = (hashCode13 + (list == null ? 0 : list.hashCode())) * 31;
        List<FeatureTemplate> list2 = this.D;
        int hashCode15 = (hashCode14 + (list2 == null ? 0 : list2.hashCode())) * 31;
        String str7 = this.F;
        int hashCode16 = (hashCode15 + (str7 == null ? 0 : str7.hashCode())) * 31;
        String str8 = this.y;
        int hashCode17 = (hashCode16 + (str8 == null ? 0 : str8.hashCode())) * 31;
        String str9 = this.d;
        int hashCode18 = (hashCode17 + (str9 == null ? 0 : str9.hashCode())) * 31;
        TimeInfo timeInfo = this.J;
        return hashCode18 + (timeInfo != null ? timeInfo.hashCode() : 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            LayerServiceInfo layerServiceInfo = (LayerServiceInfo) obj;
            LayerServiceCapabilities layerServiceCapabilities = this.G;
            if (layerServiceCapabilities == null) {
                if (layerServiceInfo.G != null) {
                    return false;
                }
            } else if (!layerServiceCapabilities.equals(layerServiceInfo.G)) {
                return false;
            }
            if (this.j == layerServiceInfo.j && this.H == layerServiceInfo.H && this.I == layerServiceInfo.I && this.N == layerServiceInfo.N && this.L == layerServiceInfo.L && this.M == layerServiceInfo.M) {
                String str = this.C;
                if (str == null) {
                    if (layerServiceInfo.C != null) {
                        return false;
                    }
                } else if (!str.equals(layerServiceInfo.C)) {
                    return false;
                }
                String str2 = this.s;
                if (str2 == null) {
                    if (layerServiceInfo.s != null) {
                        return false;
                    }
                } else if (!str2.equals(layerServiceInfo.s)) {
                    return false;
                }
                DrawingInfo drawingInfo = this.t;
                if (drawingInfo == null) {
                    if (layerServiceInfo.t != null) {
                        return false;
                    }
                } else if (!drawingInfo.equals(layerServiceInfo.t)) {
                    return false;
                }
                MapGeometry mapGeometry = this.m;
                if (mapGeometry == null) {
                    if (layerServiceInfo.m != null) {
                        return false;
                    }
                } else if (!mapGeometry.equals(layerServiceInfo.m)) {
                    return false;
                }
                LinkedHashMap<String, FeatureType> linkedHashMap = this.B;
                if (linkedHashMap == null) {
                    if (layerServiceInfo.B != null) {
                        return false;
                    }
                } else if (!linkedHashMap.equals(layerServiceInfo.B)) {
                    return false;
                }
                LinkedHashMap<String, Field> linkedHashMap2 = this.A;
                if (linkedHashMap2 == null) {
                    if (layerServiceInfo.A != null) {
                        return false;
                    }
                } else if (!linkedHashMap2.equals(layerServiceInfo.A)) {
                    return false;
                }
                String str3 = this.u;
                if (str3 == null) {
                    if (layerServiceInfo.u != null) {
                        return false;
                    }
                } else if (!str3.equals(layerServiceInfo.u)) {
                    return false;
                }
                String str4 = this.x;
                if (str4 == null) {
                    if (layerServiceInfo.x != null) {
                        return false;
                    }
                } else if (!str4.equals(layerServiceInfo.x)) {
                    return false;
                }
                if (this.z == layerServiceInfo.z && this.h == layerServiceInfo.h && Double.doubleToLongBits(this.o) == Double.doubleToLongBits(layerServiceInfo.o) && Double.doubleToLongBits(this.n) == Double.doubleToLongBits(layerServiceInfo.n)) {
                    String str5 = this.i;
                    if (str5 == null) {
                        if (layerServiceInfo.i != null) {
                            return false;
                        }
                    } else if (!str5.equals(layerServiceInfo.i)) {
                        return false;
                    }
                    String str6 = this.w;
                    if (str6 == null) {
                        if (layerServiceInfo.w != null) {
                            return false;
                        }
                    } else if (!str6.equals(layerServiceInfo.w)) {
                        return false;
                    }
                    if (this.k != layerServiceInfo.k) {
                        return false;
                    }
                    Renderer renderer = this.r;
                    if (renderer == null) {
                        if (layerServiceInfo.r != null) {
                            return false;
                        }
                    } else if (!renderer.equals(layerServiceInfo.r)) {
                        return false;
                    }
                    SpatialReference spatialReference = this.v;
                    if (spatialReference == null) {
                        if (layerServiceInfo.v != null) {
                            return false;
                        }
                    } else if (!spatialReference.equals(layerServiceInfo.v)) {
                        return false;
                    }
                    List<Integer> list = this.l;
                    if (list == null) {
                        if (layerServiceInfo.l != null) {
                            return false;
                        }
                    } else if (!list.equals(layerServiceInfo.l)) {
                        return false;
                    }
                    List<FeatureTemplate> list2 = this.D;
                    if (list2 == null) {
                        if (layerServiceInfo.D != null) {
                            return false;
                        }
                    } else if (!list2.equals(layerServiceInfo.D)) {
                        return false;
                    }
                    String str7 = this.F;
                    if (str7 == null) {
                        if (layerServiceInfo.F != null) {
                            return false;
                        }
                    } else if (!str7.equals(layerServiceInfo.F)) {
                        return false;
                    }
                    String str8 = this.y;
                    if (str8 == null) {
                        if (layerServiceInfo.y != null) {
                            return false;
                        }
                    } else if (!str8.equals(layerServiceInfo.y)) {
                        return false;
                    }
                    String str9 = this.d;
                    if (str9 == null) {
                        if (layerServiceInfo.d != null) {
                            return false;
                        }
                    } else if (!str9.equals(layerServiceInfo.d)) {
                        return false;
                    }
                    TimeInfo timeInfo = this.J;
                    if (timeInfo == null) {
                        if (layerServiceInfo.J != null) {
                            return false;
                        }
                    } else if (!timeInfo.equals(layerServiceInfo.d)) {
                        return false;
                    }
                    return true;
                }
                return false;
            }
            return false;
        }
        return false;
    }

    public void setDefinitionExpression(String str) {
        this.C = str;
    }

    public void setRenderer(Renderer renderer) {
        this.r = renderer;
    }

    public void setMinScale(double d) {
        this.n = d;
    }

    public void setMaxScale(double d) {
        this.o = d;
    }

    public EditFieldsInfo getEditFieldsInfo() {
        return this.K;
    }

    public void setEditFieldInfo(EditFieldsInfo editFieldsInfo) {
        this.K = editFieldsInfo;
    }

    public OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures() {
        return this.O;
    }

    public void setOwnershipBasedAccessControlForFeatures(OwnershipBasedAccessControlForFeatures ownershipBasedAccessControlForFeatures) {
        this.O = ownershipBasedAccessControlForFeatures;
    }
}
